using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;

namespace WisdriContactsAndroid
{
    [Activity(Label = "查询")]			
    public class Search : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create your application here
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Search);

            var buttonSearch = FindViewById<Button>(Resource.Id.buttonSearch);
            var editTextSearch = FindViewById<TextView>(Resource.Id.editTextSearch);

            buttonSearch.Click += (object sender, EventArgs e) =>
            {
                Activity act = this as Activity;
                Intent intent = new Intent();
                intent.SetClass(act, typeof(ContactList));  

                Bundle b = new Bundle();  
                b.PutString("filter", editTextSearch.Text);
                intent.PutExtras(b);

                act.StartActivity(intent);  
            };
        }
    }
}

